home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / doodle_d.swf / scripts / DefineSprite_6_en15 / frame_1 / DoAction.as
Text File  |  2013-04-24  |  2KB  |  78 lines

  1. function onEnterFrame()
  2. {
  3.    if(_root.shieldMC.hitTest(_X,_Y,true) && _root.shieldLevel >= 2)
  4.    {
  5.       dx = 0;
  6.       dy = 0;
  7.    }
  8.    timer++;
  9.    if(timer < 20)
  10.    {
  11.       if(test != 0)
  12.       {
  13.          _xscale = _xscale + 6;
  14.       }
  15.       else
  16.       {
  17.          _yscale = _yscale + 6;
  18.       }
  19.    }
  20.    else if(timer < 40)
  21.    {
  22.       if(test != 0)
  23.       {
  24.          _xscale = _xscale - 6;
  25.       }
  26.       else
  27.       {
  28.          _yscale = _yscale - 6;
  29.       }
  30.    }
  31.    else
  32.    {
  33.       timer = 0;
  34.       _xscale = 100;
  35.       _yscale = 100;
  36.    }
  37.    _X = _X + dx;
  38.    _Y = _Y + dy;
  39.    if(_Y > 880 || _Y < 0)
  40.    {
  41.       dy *= -1;
  42.       _Y = _Y + dy * 2;
  43.    }
  44.    if(_X < 0 || _X > 640)
  45.    {
  46.       dx *= -1;
  47.       _X = _X + dx * 2;
  48.    }
  49.    if(this.hitTest(_root.ship))
  50.    {
  51.       depth = _root.getNextHighestDepth();
  52.       _root.attachMovie("exp","exp" + depth,depth);
  53.       exp = eval("_root.exp" + depth);
  54.       exp._x = _X;
  55.       exp._y = _Y;
  56.       _root.eAmount--;
  57.       _root.death();
  58.       this.removeMovieClip();
  59.    }
  60.    if(h <= 0)
  61.    {
  62.       _root.eAmount--;
  63.       _root.points += 420;
  64.       _root.eD = _root.eD + 1;
  65.       depth = _root.getNextHighestDepth();
  66.       _root.attachMovie("exp","exp" + depth,depth);
  67.       exp = eval("_root.exp" + depth);
  68.       exp._x = _X;
  69.       exp._y = _Y;
  70.       this.removeMovieClip();
  71.    }
  72. }
  73. dx = Math.random() * 3 + 3;
  74. dy = (Math.random() * 2 + 2) * -1;
  75. h = 10;
  76. timer = 0;
  77. test = Math.floor(Math.random() * 2);
  78.